Crystal Reports Integration

Generate PDF Report

Code Customization
Generate PDF Report (Not Applicable To Mobile)
Description:

This customization integrates Crystal Reports with an Iron Speed Designer application. When a button is clicked an existing Crystal Reports document (.rpt file) is populated and displayed in Adobe's Portable Document Format (PDF). This code customization only works in Full Trust or High Trust applications, and will not work when hosted under Medium Trust.

Procedure:

Step 1:  Use Microsoft Visual Studio to create a Crystal Report object and include it in the current project.

Step 2:  In Layout Editor, select an editable control, then drag and drop a Button (Themed) from Toolbox to a desired cell location.

Step 3:  Display the Properties dialog and set the Button text property of the new button.

  Button text: Export to PDF
  Add 'PostBack' = 'true' attribute on Attributes tab

Step 4:  Build the application.

Step 5:  Insert the following two lines at the top of the page's safe class file where the code gets inserted. These statements cause the necessary Crystal Reports objects to be linked into your application.

 using CrystalDecisions.CrystalReports.Engine;
 using CrystalDecisions.Shared;
        

Step 6:  Use this wizard to insert code customization.

Step 7:  Build and run the application.

If you do not have Microsoft Visual Studio, you may have to copy the Crystal Reports DLL into the Bin folder of your application and make additional changes to your project as described below.

Copy the following DLL's into the Bin folder of your application.
CrystalDecisions.Shared.dll
CrystalDecisions.CrystalReports.Engine.dll

These DLL's may be located at:
For .NET 2.0:
C:\Program Files\Common Files\Business Objects\2.7\Managed

.NET 1.1:
C:\Program Files\Common Files\Crystal Decisions\1.1\Managed

Note that Crystal Decisions changed their name to Business Objects, so their directory names changed as well.

Additionally, for .NET 1.1 only, modify the CompileApplication.rsp and change the following two lines as follows:

/reference:

Add at the end of the line: (note comma to separate previous item)
,CrystalDecisions.Shared.dll,CrystalDecisions.CrystalReports.Engine.dll

/imports: Add at the end of the line: (note comma to separate previous item)
,CrystalDecisions.CrystalReports.Engine,CrystalDecisions.Shared

Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

Terms of Service Privacy Statement